<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/15
 * Time: 9:37
 */

namespace app\admin\model;

use traits\model\SoftDelete;

class Authen extends Base
{
    use SoftDelete;

    protected $autoWriteTimestamp = 'datetime';
    //应用状态
    public function getStatusAttr($value)
    {
        $status = [1=>'普通用户',2=>'禁用',3=>'认证用户',4=>'达人用户'];
        return $status[$value];
    }

    //是否认证
    public function getAuthAttr($value)
    {
        $auth = [1=>'认证',2=>'未认证'];
        return $auth[$value];
    }

    //排序
    public function getChannelAttr($value)
    {
        $channel = [0=>'未定义频道', 1=>'建筑频道', 2=>'科学频道', 3=>'汽车频道', 4=>'电子频道', 5=>'家具频道'];
        return $channel[$value];
    }

    //归属   0父集  1-5子集元素
    public function getTypelAttr($value)
    {
        $type = [0=>'顶级频道', 1=>'建筑频道', 2=>'科学频道', 3=>'汽车频道', 4=>'电子频道', 5=>'家具频道'];
        return $type[$value];
    }

    public function occu()
    {
        return $this->belongsTo('Occu','occu_id','id');
    }
}